<?php
namespace app\index\model;
use frame\app\Model;
use frame\lib\Db;

class Good extends Model{
    public static function list($query = '')
    {
        $uid = $_SESSION['user']['id'];
        if($query){
            $list = Db::name('good')->where(['user_id' => $uid,'delete_time' => 0])->like('good_name',"%$query%")->select();
        }else{
            $list = Db::name('good')->where(['user_id' => $uid,'delete_time' => 0])->select();
        }
        return $list;
    }
  
}